﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MultiplyTableForProst
{
    public class NumericAndMultiplyTableCollection: List<NumericAndMultiplyTable>
    {
        public int EnteredNumber
        {
            get;
            set;
        }
        public List<NumericAndMultiplyTable> NumericAndTables
        {
            get;
            private set;
        }

        public NumericAndMultiplyTableCollection(int number)
        {
            EnteredNumber = number;
            NumericAndTables = CreateNumericAndMultiplyTableCollection(number);
        }

        private List<NumericAndMultiplyTable> CreateNumericAndMultiplyTableCollection(int number)
        {
            List<NumericAndMultiplyTable> numericAndTables = new List<NumericAndMultiplyTable>();
            List<int> prostNumericList = ProstNumericList.CreateProstNumericList(number);
            
            foreach (int num in prostNumericList)
            {
                numericAndTables.Add(new NumericAndMultiplyTable(num));
            }

            return numericAndTables;
        }
    }
}
